/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jkoa.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "peribadi")
@NamedQueries({
    @NamedQuery(name = "Peribadi.findAll", query = "SELECT p FROM Peribadi p")})
public class Peribadi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_peribadi")
    private Integer idPeribadi;
    @Column(name = "id_mohon")
    private Integer idMohon;
    @Column(name = "id_majikan")
    private Integer idMajikan;
    @Column(name = "id_pekerja")
    private Integer idPekerja;
    @Basic(optional = false)
    @Column(name = "nama")
    private String nama;
    
    @ManyToOne
    @JoinColumn(name = "kod_pengenalan")
    private KodPengenalan kodPengenalan;
    @Column(name = "no_pengenalan")
    private String noPengenalan;
//    @Column(name = "jantina")
//    private String jantina;
    @Column(name = "alamat_surat")
    private String alamatSurat;
    @Column(name = "alamat_surat2")
    private String alamatSurat2;
    @Column(name = "alamat_surat3")
    private String alamatSurat3;
    @Column(name = "alamat_surat4")
    private String alamatSurat4;
    @Column(name = "poskod_surat")
    private String poskodSurat;
    
    @ManyToOne
    @JoinColumn(name = "negeri_surat")    
    private KodNegeri negeriSurat;
    
//    @Column(name = "negeri_surat")
//    private String negeriSurat;
    @Column(name = "alamat")
    private String alamat;
    @Column(name = "alamat2")
    private String alamat2;
    @Column(name = "alamat3")
    private String alamat3;
    @Column(name = "alamat4")
    private String alamat4;
    @Column(name = "poskod")
    private String poskod;
    
    @ManyToOne
    @JoinColumn(name = "negeri")    
    private KodNegeri negeri;
    
//    @Column(name = "negeri")
//    private String negeri;
    @Column(name = "email")
    private String email;
    @Column(name = "no_tel1")
    private String noTel1;
    @Column(name = "no_tel2")
    private String noTel2;
    @Column(name = "no_tel_pjaga")
    private String noTelPjaga;
    @Column(name = "trh_lahir")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhLahir;
    @ManyToOne
    @JoinColumn(name = "kod_warga")    
    private KodWarganegara warganegara;
    
//    @Column(name = "kod_warga")
//    private String kodWarga;
    @ManyToOne
    @JoinColumn(name = "kod_jantina")
    private KodJantina jantina;
    
    @ManyToOne
    @JoinColumn(name = "taraf_kahwin")
    private KodTarafKahwin tarafKahwin;
    
    @ManyToOne
    @JoinColumn(name = "kod_suku")
    private KodSuku suku;
    
    @ManyToOne
    @JoinColumn(name = "kod_agama")
    private KodAgama agama;
    
    @Column(name = "kecacatan")
    private String kecacatan;
    @Column(name = "kecacatan_lain")
    private String kecacatanLain;
    
    @Column(name = "aktif")
    private Character aktif;   
    
    @ManyToOne
    @JoinColumn(name = "dimasuk" , nullable=false)
    private Pengguna dimasukOleh;
    
    @Basic(optional = false)
    @Column(name = "trh_masuk")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMasuk;
    
    @Column(name = "dikkini")
    private String dikkini;
    
    @Column(name = "trh_kkini")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhKkini;

    public Peribadi() {
    }

    public Peribadi(Integer idPeribadi) {
        this.idPeribadi = idPeribadi;
    }

    public Peribadi(Integer idPeribadi, String nama, Pengguna dimasukOleh, Date trhMasuk) {
        this.idPeribadi = idPeribadi;
        this.nama = nama;
        this.dimasukOleh = dimasukOleh;
        this.trhMasuk = trhMasuk;
    }

    public Integer getIdPeribadi() {
        return idPeribadi;
    }

    public void setIdPeribadi(Integer idPeribadi) {
        this.idPeribadi = idPeribadi;
    }

    public Integer getIdMohon() {
        return idMohon;
    }

    public void setIdMohon(Integer idMohon) {
        this.idMohon = idMohon;
    }

    public Integer getIdMajikan() {
        return idMajikan;
    }

    public void setIdMajikan(Integer idMajikan) {
        this.idMajikan = idMajikan;
    }

    public Integer getIdPekerja() {
        return idPekerja;
    }

    public void setIdPekerja(Integer idPekerja) {
        this.idPekerja = idPekerja;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    public KodPengenalan getKodPengenalan() {
        return kodPengenalan;
    }

    public void setKodPengenalan(KodPengenalan kodPengenalan) {
        this.kodPengenalan = kodPengenalan;
    }

    public String getNoPengenalan() {
        return noPengenalan;
    }

    public void setNoPengenalan(String noPengenalan) {
        this.noPengenalan = noPengenalan;
    }   

    public String getAlamatSurat() {
        return alamatSurat;
    }

    public void setAlamatSurat(String alamatSurat) {
        this.alamatSurat = alamatSurat;
    }

    public String getAlamatSurat2() {
        return alamatSurat2;
    }

    public void setAlamatSurat2(String alamatSurat2) {
        this.alamatSurat2 = alamatSurat2;
    }

    public String getAlamatSurat3() {
        return alamatSurat3;
    }

    public void setAlamatSurat3(String alamatSurat3) {
        this.alamatSurat3 = alamatSurat3;
    }

    public String getAlamatSurat4() {
        return alamatSurat4;
    }

    public void setAlamatSurat4(String alamatSurat4) {
        this.alamatSurat4 = alamatSurat4;
    }

    public String getPoskodSurat() {
        return poskodSurat;
    }

    public void setPoskodSurat(String poskodSurat) {
        this.poskodSurat = poskodSurat;
    }

    public KodNegeri getNegeriSurat() {
        return negeriSurat;
    }

    public void setNegeriSurat(KodNegeri negeriSurat) {
        this.negeriSurat = negeriSurat;
    }

    public String getAlamat() {
        return alamat;
    }

    public void setAlamat(String alamat) {
        this.alamat = alamat;
    }

    public String getAlamat2() {
        return alamat2;
    }

    public void setAlamat2(String alamat2) {
        this.alamat2 = alamat2;
    }

    public String getAlamat3() {
        return alamat3;
    }

    public void setAlamat3(String alamat3) {
        this.alamat3 = alamat3;
    }

    public String getAlamat4() {
        return alamat4;
    }

    public void setAlamat4(String alamat4) {
        this.alamat4 = alamat4;
    }

    public String getPoskod() {
        return poskod;
    }

    public void setPoskod(String poskod) {
        this.poskod = poskod;
    }

    public KodNegeri getNegeri() {
        return negeri;
    }

    public void setNegeri(KodNegeri negeri) {
        this.negeri = negeri;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getNoTel1() {
        return noTel1;
    }

    public void setNoTel1(String noTel1) {
        this.noTel1 = noTel1;
    }

    public String getNoTel2() {
        return noTel2;
    }

    public void setNoTel2(String noTel2) {
        this.noTel2 = noTel2;
    }

    public String getNoTelPjaga() {
        return noTelPjaga;
    }

    public void setNoTelPjaga(String noTelPjaga) {
        this.noTelPjaga = noTelPjaga;
    }

    public Date getTrhLahir() {
        return trhLahir;
    }

    public void setTrhLahir(Date trhLahir) {
        this.trhLahir = trhLahir;
    }

    public KodWarganegara getWarganegara() {
        return warganegara;
    }

    public void setWarganegara(KodWarganegara warganegara) {
        this.warganegara = warganegara;
    }  

    public KodJantina getJantina() {
        return jantina;
    }

    public void setJantina(KodJantina jantina) {
        this.jantina = jantina;
    }

    public KodAgama getAgama() {
        return agama;
    }

    public void setAgama(KodAgama agama) {
        this.agama = agama;
    }

    public KodSuku getSuku() {
        return suku;
    }

    public void setSuku(KodSuku suku) {
        this.suku = suku;
    }

    public KodTarafKahwin getTarafKahwin() {
        return tarafKahwin;
    }

    public void setTarafKahwin(KodTarafKahwin tarafKahwin) {
        this.tarafKahwin = tarafKahwin;
    }

    public String getKecacatan() {
        return kecacatan;
    }

    public void setKecacatan(String kecacatan) {
        this.kecacatan = kecacatan;
    }

    public String getKecacatanLain() {
        return kecacatanLain;
    }

    public void setKecacatanLain(String kecacatanLain) {
        this.kecacatanLain = kecacatanLain;
    }

    public Character getAktif() {
        return aktif;
    }

    public void setAktif(Character aktif) {
        this.aktif = aktif;
    }    

    public Pengguna getDimasukOleh() {
        return dimasukOleh;
    }

    public void setDimasuk(Pengguna dimasukOleh) {
        this.dimasukOleh = dimasukOleh;
    }

    public Date getTrhMasuk() {
        return trhMasuk;
    }

    public void setTrhMasuk(Date trhMasuk) {
        this.trhMasuk = trhMasuk;
    }

    public String getDikkini() {
        return dikkini;
    }

    public void setDikkini(String dikkini) {
        this.dikkini = dikkini;
    }

    public Date getTrhKkini() {
        return trhKkini;
    }

    public void setTrhKkini(Date trhKkini) {
        this.trhKkini = trhKkini;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPeribadi != null ? idPeribadi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Peribadi)) {
            return false;
        }
        Peribadi other = (Peribadi) object;
        if ((this.idPeribadi == null && other.idPeribadi != null) || (this.idPeribadi != null && !this.idPeribadi.equals(other.idPeribadi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jkoa.model.Peribadi[ idPeribadi=" + idPeribadi + " ]";
    }
    
}
